package thepackage;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class Contatos {
	
	String nome, endereco, cep, email;
	
	
	public Contatos(String nome, String endereco, String cep, String email) {
		this.nome = nome;
		this.endereco = endereco;
		this.cep = cep;
		this.email = email;
	}
	
	public void registraArquivo() throws IOException {
		FileWriter writer = new FileWriter("C:/Cadastros.txt");
		PrintWriter pw = new PrintWriter(writer);
		pw.println("NOME: " + nome);
		pw.println("ENDERECO: " + endereco);
		pw.println("CEP: " + cep);
		pw.println("E-MAIL: " + email);
		writer.close();
	}

}
